<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
    <a href="{% url 'booktest:show' 123 345 %}">show</a>
<ul>
    {% for hero in heros %}
        {% if forloop.counter|divisibleby:"2" %}
            <li style="color: red;">{{ forloop.counter }}:{{ forloop.counter0 }}:{{ hero.hname }}</li>
            {% else %}
            <li style="color: green;">{{ forloop.counter }}:{{ forloop.counter0 }}:{{ hero.hname }}</li>
        {% endif %}
    {% empty %}
        <li>啥也没找到</li>
    {% endfor %}
</ul>
</body>
</html>